package gameLogic;

public class StrategyCorner extends Strategy {

	public StrategyCorner(Board b, BoardState s, Observer ob) {
		super(b, s, ob);
	}

	@Override
	public Move[] getAllMove() {
		BoardState opposite = (side==BoardState.X) ? BoardState.O : BoardState.X;
		System.out.println(opposite);
		if(b.board[0][0] == opposite && b.isEmpty(2, 2))
			return new Move[] { new Move(2,2,side) };
		if(b.board[2][2] == opposite && b.isEmpty(0, 0))
			return new Move[] { new Move(0,0,side) };
		if(b.board[0][2] == opposite && b.isEmpty(0, 2))
			return new Move[] { new Move(0,2,side) };
		if(b.board[2][0] == opposite && b.isEmpty(2, 0))
			return new Move[] { new Move(2,0,side) };
		if(b.isEmpty(0, 0))
			return new Move[] { new Move(0,0,side) };
		if(b.isEmpty(0, 2))
			return new Move[] { new Move(0,2,side) };
		if(b.isEmpty(2, 0))
			return new Move[] { new Move(2,0,side) };
		if(b.isEmpty(2, 2))
			return new Move[] { new Move(2,2,side) };
		
		return null;
	}

	@Override
	protected int getPriority() {
		return 4;
	}

}
